import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 人员变动记录信息 */
export interface ReportTeacherFlow {
          id: number; // 编号
          processInstanceId: string; // 实例ID
          teacherId: number; // 教师ID
          teacherName?: string; // 姓名
          flowStatus: string; // 流转状态
          flowTime: string | Dayjs; // 流转日期
          remark: string; // 说明
          sort?: number; // 排序
          status?: number; // 状态
  }

// 人员变动记录 API
export const ReportTeacherFlowApi = {
  // 查询人员变动记录分页
  getReportTeacherFlowPage: async (params: any) => {
    return await request.get({ url: `/school/report-teacher-flow/page`, params })
  },

  // 查询人员变动记录详情
  getReportTeacherFlow: async (id: number) => {
    return await request.get({ url: `/school/report-teacher-flow/get?id=` + id })
  },

  // 新增人员变动记录
  createReportTeacherFlow: async (data: ReportTeacherFlow) => {
    return await request.post({ url: `/school/report-teacher-flow/create`, data })
  },

  // 修改人员变动记录
  updateReportTeacherFlow: async (data: ReportTeacherFlow) => {
    return await request.put({ url: `/school/report-teacher-flow/update`, data })
  },

  // 删除人员变动记录
  deleteReportTeacherFlow: async (id: number) => {
    return await request.delete({ url: `/school/report-teacher-flow/delete?id=` + id })
  },

  /** 批量删除人员变动记录 */
  deleteReportTeacherFlowList: async (ids: number[]) => {
    return await request.delete({ url: `/school/report-teacher-flow/delete-list?ids=${ids.join(',')}` })
  },

  // 导出人员变动记录 Excel
  exportReportTeacherFlow: async (params) => {
    return await request.download({ url: `/school/report-teacher-flow/export-excel`, params })
  },
}